package top.zuli.package01.class04;

public class ArrayTest2 {
    public static void main(String[] args) {
        int[] arr = {1,3,11,5,9,7};
        int max = arr[0];
        int min = arr[0];
        int sum = 0;
        int avg = 0;
        for (int i = 0; i < arr.length; i++) {
            if (max<arr[i]){
                max = arr[i];
            }
            if (min>arr[i]){
                min = arr[i];
            }
            sum += arr[i];
        }
        avg = sum/ arr.length;
        System.out.println("最大值是："+max);
        System.out.println("最小值是："+min);
        System.out.println("和是："+sum);
        System.out.println("平均值是："+avg);
    }
}
